﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using model;
using Bll;

public partial class inserta : System.Web.UI.Page
{
    ApplicationBll bll = new ApplicationBll();
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        model.Application app = new model.Application();
        app.Position = txtPosition.Text;
        app.Place = txtPlace.Text;
        app.Number = txtNumber.Text;
        app.Salary = txtSalary.Text;
        app.Conn = txtConn.Text;
        app.Aintro = txtAintro.Text;
        app.Eno = Session["userid"].ToString();
        try
        {
            bll.Insert(app);
            Response.Write("<script>alert('发布成功！');location.href='EA.aspx';</script>");
        }
        catch (Exception ex)
        {
            string js = "<script>alert('" + ex.Message + "');</script>";
            Response.Write(js);
        }
    }
}